package thinker.miracle.task;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import com.xxl.job.core.biz.model.ReturnT;
import com.xxl.job.core.handler.IJobHandler;
import com.xxl.job.core.handler.annotation.JobHander;

@Service
@JobHander("demoHandler")
public class DemoHandler extends IJobHandler{

	protected final Logger logger = Logger.getLogger(this.getClass());
	
	@Override
	public ReturnT<String> execute(String... arg0) throws Exception {
		try{
			
			int i = 0;
			while (i++ < 10) {
				String message = "测试 : "+i;
				logger.info("............." + message + ".................");
			}
			return ReturnT.SUCCESS;
		}catch(Exception e){
			logger.error("",e);
		}
		return ReturnT.FAIL;
	}

}
